<?php
// 文件路径: application/command/MqttSubscribe.php
namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\Output;
use app\common\mqtt\MqttClientService;

class MqttSubscribe extends Command
{
    protected function configure()
    {
        $this->setName('mqtt:subscribe')
            ->setDescription('Subscribe to MQTT topics');
    }

    protected function execute(Input $input, Output $output)
    {
        $output->writeln("Starting MQTT Subscription...");
        $mqttService = new MqttClientService();
        $mqttService->subscribeToTopics();
    }
}